package com.example.app.Entity;

import static androidx.room.ForeignKey.CASCADE;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;

@Entity(
    tableName = "health_data",
    foreignKeys = @ForeignKey(
        entity = User.class,
        parentColumns = "id",
        childColumns = "user_id",
        onDelete = CASCADE
    )
)
public class HealthData {
    @PrimaryKey(autoGenerate = true)
    private Long id;
    
    @ColumnInfo(name = "user_id")
    private Long userId;
    
    @ColumnInfo(name = "measurement_time")
    private Long measurementTime; // 时间戳
    
    private Integer pulse;
    
    // Getters & Setters
}